package com.idp.web.test.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.idp.common.persistence.Page;
import com.idp.web.test.dao.LogisticsDao;
import com.idp.web.test.dao.LogisticsHasWarehouseDao;
import com.idp.web.test.entity.Logistics;
import com.idp.web.test.entity.LogisticsHasWarehouse;
import com.idp.web.test.service.LogisticsHasWarehouseService;

/**
 * 
 * 物流和仓库多对多service实现类
 * 
 * <pre>
 * 	历史记录：
 * 	2017-06-12 Amber
 * 	新建文件
 * </pre>
 * 
 * @author
 * 
 *         <pre>
 * SD
 * 	Amber
 * PG
 *	Amber
 * UT
 *
 * MA
 *         </pre>
 * 
 * @version $Rev$
 *
 *          <p/>
 *          $Id$
 *
 */
@Service("logisticsHasWarehouseService")
public class LogisticsHasWarehouseServiceImpl implements LogisticsHasWarehouseService {

	@Resource
	private LogisticsHasWarehouseDao logisticsHasWarehouseDao;

	@Resource
	private LogisticsDao logisticsDao;

	@Override
	public Page<LogisticsHasWarehouse> findByPage(LogisticsHasWarehouse logisticsHasWarehouse,
			Page<LogisticsHasWarehouse> page) {

		page.setResult(logisticsHasWarehouseDao.find(logisticsHasWarehouse, page));

		return page;
	}

	@Override
	public List<LogisticsHasWarehouse> findBySearch(LogisticsHasWarehouse logisticsHasWarehouse) {

		return logisticsHasWarehouseDao.find(logisticsHasWarehouse);
	}

	@Override
	public LogisticsHasWarehouse getById(Integer id) {

		return logisticsHasWarehouseDao.getById(id);
	}

	@Override
	public void add(LogisticsHasWarehouse logisticsHasWarehouse) {

		logisticsHasWarehouseDao.add(logisticsHasWarehouse);
	}

	@Override
	public void update(LogisticsHasWarehouse logisticsHasWarehouse) {

		logisticsHasWarehouseDao.update(logisticsHasWarehouse);
	}

	@Override
	public void delete(Integer id) {

		logisticsHasWarehouseDao.delete(id);
	}

	@Override
	public List<Logistics> findByWarehouseId(Integer warehouseId) {

		return logisticsDao.findByWarehouseId(warehouseId);
	}

}